home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / tests / misc.test < prev    next >
Text File  |  1992-11-06  |  2KB  |  55 lines

  1. # Commands covered:  various
  2. #
  3. # This file contains a collection of miscellaneous Tcl tests that
  4. # don't fit naturally in any of the other test files.  Many of these
  5. # tests are pathological cases that caused bugs in earlier Tcl
  6. # releases.
  7. #
  8. # Copyright 1992 Regents of the University of California
  9. # Permission to use, copy, modify, and distribute this
  10. # software and its documentation for any purpose and without
  11. # fee is hereby granted, provided that this copyright notice
  12. # appears in all copies.  The University of California makes no
  13. # representations about the suitability of this software for any
  14. # purpose.  It is provided "as is" without express or implied
  15. # warranty.
  16. #
  17. # $Header: /user6/ouster/tcl/tests/RCS/misc.test,v 1.1 92/06/08 09:29:01 ouster Exp $ (Berkeley)
  18.  
  19. if {[string compare test [info procs test]] == 1} then {source defs}
  20.  
  21. test misc-1.1 {error in variable ref. in command in array reference} {
  22.     proc tstProc {} {
  23.     global a
  24.     
  25.     set tst $a([winfo name $zz])
  26.     # this is a bogus comment
  27.     # this is a bogus comment
  28.     # this is a bogus comment
  29.     # this is a bogus comment
  30.     # this is a bogus comment
  31.     # this is a bogus comment
  32.     # this is a bogus comment
  33.     # this is a bogus comment
  34.     }
  35.     set msg {}
  36.     list [catch tstProc msg] $msg
  37. } {1 {can't read "zz": no such variable}}
  38. test misc-1.2 {error in variable ref. in command in array reference} {
  39.     proc tstProc {} "
  40.     global a
  41.     
  42.     set tst \$a(\[winfo name \$\{zz)
  43.     # this is a bogus comment
  44.     # this is a bogus comment
  45.     # this is a bogus comment
  46.     # this is a bogus comment
  47.     # this is a bogus comment
  48.     # this is a bogus comment
  49.     # this is a bogus comment
  50.     # this is a bogus comment
  51.     "
  52.     set msg {}
  53.     list [catch tstProc msg] $msg $errorInfo
  54. } {1 {missing close-brace for variable name} missing\ close-brace\ for\ variable\ name\n\ \ \ \ while\ executing\n\"winfo\ name\ \$\{zz)\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ commen\ ...\"\n\ \ \ \ (parsing\ index\ for\ array\ \"a\")\n\ \ \ \ invoked\ from\ within\n\"set\ tst\ \$a(\[winfo\ name\ \$\{zz)\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ bogus\ comment\n\t#\ this\ is\ a\ \ ...\"\n\ \ \ \ (procedure\ \"tstProc\"\ line\ 4)\n\ \ \ \ invoked\ from\ within\n\"tstProc\"}
  55.